package 力扣_数学思维题;

/**263. 丑数
 * @author zx
 * @create 2022-04-24 12:23
 */
public class Num263 {
    public boolean isUgly(int n) {
        if(n < 1){
            return false;
        }
        while(n % 5 == 0){
            n /= 5;
        }
        while(n % 3 == 0){
            n /= 3;
        }
        while(n % 2 == 0){
            n /= 2;
        }
        return n == 1;
    }
}
